package model;

import java.io.Serializable;
import javax.persistence.*;
import java.util.List;


/**
 * The persistent class for the tourist database table.
 * 
 */
@Entity
@NamedQuery(name="Tourist.findAll", query="SELECT t FROM Tourist t")
public class Tourist implements Serializable {
	private static final long serialVersionUID = 1L;

	@Id
	private String email;

	private int age;

	private String name;

	private String password;

	private String telphone;

	//bi-directional many-to-one association to Horder
	@OneToMany(mappedBy="tourist")
	private List<Horder> horders;

	//bi-directional many-to-one association to Message
	@OneToMany(mappedBy="tourist")
	private List<Message> messages;

	//bi-directional many-to-one association to Rorder
	@OneToMany(mappedBy="tourist")
	private List<Rorder> rorders;

	public Tourist() {
	}

	public String getEmail() {
		return this.email;
	}

	public void setEmail(String email) {
		this.email = email;
	}

	public int getAge() {
		return this.age;
	}

	public void setAge(int age) {
		this.age = age;
	}

	public String getName() {
		return this.name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getPassword() {
		return this.password;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	public String getTelphone() {
		return this.telphone;
	}

	public void setTelphone(String telphone) {
		this.telphone = telphone;
	}

	public List<Horder> getHorders() {
		return this.horders;
	}

	public void setHorders(List<Horder> horders) {
		this.horders = horders;
	}

	public Horder addHorder(Horder horder) {
		getHorders().add(horder);
		horder.setTourist(this);

		return horder;
	}

	public Horder removeHorder(Horder horder) {
		getHorders().remove(horder);
		horder.setTourist(null);

		return horder;
	}

	public List<Message> getMessages() {
		return this.messages;
	}

	public void setMessages(List<Message> messages) {
		this.messages = messages;
	}

	public Message addMessage(Message message) {
		getMessages().add(message);
		message.setTourist(this);

		return message;
	}

	public Message removeMessage(Message message) {
		getMessages().remove(message);
		message.setTourist(null);

		return message;
	}

	public List<Rorder> getRorders() {
		return this.rorders;
	}

	public void setRorders(List<Rorder> rorders) {
		this.rorders = rorders;
	}

	public Rorder addRorder(Rorder rorder) {
		getRorders().add(rorder);
		rorder.setTourist(this);

		return rorder;
	}

	public Rorder removeRorder(Rorder rorder) {
		getRorders().remove(rorder);
		rorder.setTourist(null);

		return rorder;
	}

}